<?php
class Plugin_Helper_Session extends Zend_Controller_Action_Helper_Abstract {

    function direct($params=false) {
        if($params){
            return $_SESSION['helper_session'] = $params;
        }else{
            return $this;
        }
    }

    public function setSession($str){
        $_SESSION['helper_session'] = $str;
    }

    public function getSession(){
        if( isset($_SESSION['helper_session']) ){
            return $_SESSION['helper_session'];
        }else{
            return false;
        }
    }

    public function clearSession(){
        if( isset($_SESSION['helper_session']) ){
            unset($_SESSION['helper_session']);
        }
        return true;
    }
    
    function  __call($name,  $arguments) {
        if( method_exists($this, $name) ){
            return call_user_func_array(array($this,$name), $arguments);
        }else{
            //TODO exception
            die('Metodo nao encontrado.');
        }
    }
}